
export default {
  props: {
    message: {
      type: String,
      default: 'Hello',
    },
  },
  data() {
    return {
      name: 'World aaa',
      color:20
    };
  },
  methods: {
    anniu(masg = '') {
      if (!!masg) {
        console.log(masg);
        return
      }
      console.log('aaa');
      try {
        this.$emit('anniu', '子组件调用父组件的方法并传参');
      } catch (error) {
        console.log(error);
      }
    },
    ziticlick() {
      console.log('ziti');
    }
  },


  template: `<div>
    <p @click="ziticlick">子组件:{{message}}</p>
    <button @click="anniu()">子组件传参按钮</button>    
  </div>`,
};